package com.project.purchase.Service.Imp;

import com.project.purchase.Service.IGoods;
import com.project.purchase.entity.Goods;
import com.project.purchase.mapper.GoodsMapper;
import com.project.purchase.vo.GoodsWithPro;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author VX5
 * @Title: QZP
 * @ProjectName purchase
 * @Description: TODO
 * @date ${DAT}20:12
 */
@Service
public class GoodsImp implements IGoods {
    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public List<GoodsWithPro> GetAll() {
        return goodsMapper.GetAll();
    }

    @Override
    public List<GoodsWithPro> getByNameAndModel(Map<String, Object> map) {
        return goodsMapper.getByNameAndModel(map);
    }

    @Override
    public void deletByID(String id) {
        goodsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void addGoods(Goods goods) {
        goodsMapper.insertSelective(goods);
    }


}
